package com.dongnao.network.nio_hashcat;

import java.io.IOException;
import java.nio.channels.SelectableChannel;

/**
 * @author sjy
 * @date 2024年05月12日 16:58
 */
public interface ChannelHandler {

    /**
     * Channel注册到Selector后被调用
     * @param channel
     * @throws IOException
     */
    void channelRegistered(SelectableChannel channel) throws IOException;

    /**
     * Channel激活后被调用
     * @param channel
     * @throws IOException
     */
    void channelActive(SelectableChannel channel) throws IOException;

    /**
     * 有数据可读时被调用
     * @param channel
     * @throws IOException
     */
    void channelRead(SelectableChannel channel) throws IOException;
}
